//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.lyq.bean.mySql;

import com.lyq.bean.Course;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;

public class SeekTeachC_Sql {
    public SeekTeachC_Sql() {
    }

    public List<Course> seekTeachC_Sql(String tNo, List<Course> list) {
        (new MysqlLinking()).getLink();
        Connection conn = MysqlLinking.conn;
        if (conn != null) {
            try {
                String sql = "select * from course where C_Teacher_ID=?";
                PreparedStatement ps = conn.prepareStatement(sql);
                ps.setString(1, tNo);
                ResultSet rs = ps.executeQuery();

                while(rs.next()) {
                    Course c = new Course();
                    c.setNo(rs.getString("C_No"));
                    c.setName(rs.getString("C_Name"));
                    c.setTime(rs.getString("C_Time"));
                    c.setPlace(rs.getString("C_Place"));
                    c.setCredit(rs.getString("C_Credit"));
                    c.setLimitNum(rs.getString("C_LimitNum"));
                    c.setResidueNum(rs.getString("C_ResidueNum"));
                    list.add(c);
                }
            } catch (Exception var8) {
                Exception e = var8;
                e.printStackTrace();
            }
        } else {
            System.out.println("数据库连接错误！");
        }

        return list;
    }
}
